@import (reference) '~antd/es/style/themes/variable';

.loader {
  --background: linear-gradient(135deg, #23C4F8, #275EFE);
  --shadow: rgba(39, 94, 254, 0.28);
  --text: #6C7486;
  --page: rgba(255, 255, 255, 0.36);
  --page-fold: rgba(255, 255, 255, 0.52);
  --duration: 3s;
  --size: 1;
  width: calc(200px * var(--size));
  height: calc(140px * var(--size));
  position: relative;
  margin: 0 auto;

  &[data-size="small"] {
    --size: 0.5;
  }

  &[data-size="default"] {
    --size: 1;
  }

  &[data-size="larger"] {
    --size: 1.5;
  }

  &:before,
  &:after {
    --r: -6deg;
    content: "";
    position: absolute;
    bottom: 8px;
    width: 120px;
    top: 80%;
    box-shadow: 0 16px 12px var(--shadow);
    transform: rotate(var(--r));
  }

  &:before {
    left: 4px;
  }

  &:after {
    --r: 6deg;
    right: 4px;
  }

  & div {
    width: 100%;
    height: 100%;
    border-radius: 13px;
    position: relative;
    z-index: 1;
    perspective: 600px;
    box-shadow: 0 4px 6px var(--shadow);
    background-image: var(--background);
  }

  & div ul {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
  }

  & div ul li {
    --r: 180deg;
    --o: 0;
    --c: var(--page);
    position: absolute;
    top: 10px;
    left: 10px;
    transform-origin: 100% 50%;
    color: var(--c);
    opacity: var(--o);
    transform: rotateY(var(--r));
    -webkit-animation: var(--duration) ease infinite;
    animation: var(--duration) ease infinite;
  }

  & div ul li:nth-child(2) {
    --c: var(--page-fold);
    -webkit-animation-name: page-2;
    animation-name: page-2;
  }

  & div ul li:nth-child(3) {
    --c: var(--page-fold);
    -webkit-animation-name: page-3;
    animation-name: page-3;
  }

  & div ul li:nth-child(4) {
    --c: var(--page-fold);
    -webkit-animation-name: page-4;
    animation-name: page-4;
  }

  & div ul li:nth-child(5) {
    --c: var(--page-fold);
    -webkit-animation-name: page-5;
    animation-name: page-5;
  }

  & div ul li svg {
    width: calc(90px * var(--size));
    height: calc(120px * var(--size));
    display: block;
  }

  & div ul li {
    top: calc(10px * var(--size));
    left: calc(10px * var(--size));
  }

  &:before,
  &:after {
    bottom: calc(8px * var(--size));
    width: calc(120px * var(--size));
  }

  & span {
    margin-top: calc(20px * var(--size));
  }

  & div ul li:first-child {
    --r: 0deg;
    --o: 1;
  }

  & div ul li:last-child {
    --o: 1;
  }

  & span {
    display: block;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 20px;
    text-align: center;
    color: var(--text);
  }
}



@keyframes page-2 {
  0% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  35%,
  100% {
    opacity: 0;
  }

  50%,
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes page-3 {
  15% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }

  65%,
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes page-4 {
  30% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  65%,
  100% {
    opacity: 0;
  }

  80%,
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes page-5 {
  45% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  65% {
    opacity: 1;
  }

  80%,
  100% {
    opacity: 0;
  }

  95%,
  100% {
    transform: rotateY(0deg);
  }
}

.loading-page {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  .loading-text {
    font-size: 14px;
    margin-top: 20px;
  }
}

.load_keyframes_body {
  height: 120px;

  .load_keyframes_content {
    grid-gap: 4px;
    display: grid;
    grid-template-columns: 30px 30px;
    grid-template-rows: 30px 30px;
    animation: load_transform 1s linear infinite;

    & div {
      border-radius: 10px;
      background-color: @primary-color;
      animation: load_transform_item 1s ease infinite;
    }
  }
}


@keyframes load_transform {
  0% {
    grid-gap: 4px;
    transform: rotate(0deg);
  }

  50% {
    grid-gap: 30px;
    transform: rotate(90deg);
  }

  100% {
    grid-gap: 4px;
    transform: rotate(180deg);
  }
}

@keyframes load_transform_item {
  0% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(90deg);
  }

  95% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(180deg);
  }
}
